/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package svp;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author kandamaran
 */
@Entity
@Table(name = "customer_tbl", catalog = "svpdatabase", schema = "")
@XmlRootElement
@NamedQueries({ 
   @NamedQuery(name = "CustomerTbl.name", query = "SELECT c.customerTblPK.customerName FROM CustomerTbl c"),
   @NamedQuery(name = "CustomerTbl.id", query = "SELECT c.customerTblPK.customerId FROM CustomerTbl c"),
    @NamedQuery(name = "CustomerTbl.MasterPhNo", query = "SELECT c.customerphoneOff1 FROM CustomerTbl c"),
    @NamedQuery(name = "CustomerTbl.findAll", query = "SELECT c FROM CustomerTbl c"),
    @NamedQuery(name = "CustomerTbl.findByCustomerId", query = "SELECT c FROM CustomerTbl c WHERE c.customerTblPK.customerId = :customerId"),
    @NamedQuery(name = "CustomerTbl.findByCustomerName", query = "SELECT c FROM CustomerTbl c WHERE c.customerTblPK.customerName = :customerName"),
    @NamedQuery(name = "CustomerTbl.findByCustomerAddress", query = "SELECT c FROM CustomerTbl c WHERE c.customerAddress = :customerAddress"),
    @NamedQuery(name = "CustomerTbl.findByCustomerCity", query = "SELECT c FROM CustomerTbl c WHERE c.customerCity = :customerCity"),
    @NamedQuery(name = "CustomerTbl.findByCustomerState", query = "SELECT c FROM CustomerTbl c WHERE c.customerState = :customerState"),
    @NamedQuery(name = "CustomerTbl.findByCustomerpostalCode", query = "SELECT c FROM CustomerTbl c WHERE c.customerpostalCode = :customerpostalCode"),
    @NamedQuery(name = "CustomerTbl.findByCustomerphoneOff1", query = "SELECT c FROM CustomerTbl c WHERE c.customerphoneOff1 = :customerphoneOff1"),
    @NamedQuery(name = "CustomerTbl.findByCustomerphoneOff2", query = "SELECT c FROM CustomerTbl c WHERE c.customerphoneOff2 = :customerphoneOff2"),
    @NamedQuery(name = "CustomerTbl.findByCustomerphoneRes", query = "SELECT c FROM CustomerTbl c WHERE c.customerphoneRes = :customerphoneRes"),
    @NamedQuery(name = "CustomerTbl.findByCustomermobileNo1", query = "SELECT c FROM CustomerTbl c WHERE c.customermobileNo1 = :customermobileNo1"),
    @NamedQuery(name = "CustomerTbl.findByCustomermobileNo2", query = "SELECT c FROM CustomerTbl c WHERE c.customermobileNo2 = :customermobileNo2"),
    @NamedQuery(name = "CustomerTbl.findByCustomerComment", query = "SELECT c FROM CustomerTbl c WHERE c.customerComment = :customerComment")})
public class CustomerTbl implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected CustomerTblPK customerTblPK;
//    @Column(name = "customer_name")
//    private String customerName;
//    @Column(name = "customer_id")
//    private String customerId;
   @Column(name = "customer_address")
    private String customerAddress;
    @Column(name = "customer_city")
    private String customerCity;
    @Column(name = "customer_state")
    private String customerState;
    @Column(name = "customer_postalCode")
    private String customerpostalCode;
    @Column(name = "customer_phoneOff1")
    private String customerphoneOff1;
    @Column(name = "customer_phoneOff2")
    private String customerphoneOff2;
    @Column(name = "customer_phoneRes")
    private String customerphoneRes;
    @Column(name = "customer_mobileNo1")
    private String customermobileNo1;
    @Column(name = "customer_mobileNo2")
    private String customermobileNo2;
    @Column(name = "customer_comment")
    private String customerComment;

    public CustomerTbl() {
    }

    public CustomerTbl(CustomerTblPK customerTblPK) {
        this.customerTblPK = customerTblPK;
    }

    public CustomerTbl(String customerId, String customerName) {
        this.customerTblPK = new CustomerTblPK(customerId, customerName);
    }

    public CustomerTblPK getCustomerTblPK() {
        return customerTblPK;
    }

    public void setCustomerTblPK(CustomerTblPK customerTblPK) {
        this.customerTblPK = customerTblPK;
    }
    
    public String getCustomerAddress() {
        return customerAddress;
    }

    public void setCustomerAddress(String customerAddress) {
        this.customerAddress = customerAddress;
    }

    public String getCustomerCity() {
        return customerCity;
    }

    public void setCustomerCity(String customerCity) {
        this.customerCity = customerCity;
    }

    public String getCustomerState() {
        return customerState;
    }

    public void setCustomerState(String customerState) {
        this.customerState = customerState;
    }

    public String getCustomerpostalCode() {
        return customerpostalCode;
    }

    public void setCustomerpostalCode(String customerpostalCode) {
        this.customerpostalCode = customerpostalCode;
    }

    public String getCustomerphoneOff1() {
        return customerphoneOff1;
    }

    public void setCustomerphoneOff1(String customerphoneOff1) {
        this.customerphoneOff1 = customerphoneOff1;
    }

    public String getCustomerphoneOff2() {
        return customerphoneOff2;
    }

    public void setCustomerphoneOff2(String customerphoneOff2) {
        this.customerphoneOff2 = customerphoneOff2;
    }

    public String getCustomerphoneRes() {
        return customerphoneRes;
    }

    public void setCustomerphoneRes(String customerphoneRes) {
        this.customerphoneRes = customerphoneRes;
    }

    public String getCustomermobileNo1() {
        return customermobileNo1;
    }

    public void setCustomermobileNo1(String customermobileNo1) {
        this.customermobileNo1 = customermobileNo1;
    }

    public String getCustomermobileNo2() {
        return customermobileNo2;
    }

    public void setCustomermobileNo2(String customermobileNo2) {
        this.customermobileNo2 = customermobileNo2;
    }

    public String getCustomerComment() {
        return customerComment;
    }

    public void setCustomerComment(String customerComment) {
        this.customerComment = customerComment;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (customerTblPK != null ? customerTblPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CustomerTbl)) {
            return false;
        }
        CustomerTbl other = (CustomerTbl) object;
        if ((this.customerTblPK == null && other.customerTblPK != null) || (this.customerTblPK != null && !this.customerTblPK.equals(other.customerTblPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "svp.CustomerTbl[ customerTblPK=" + customerTblPK + " ]";
    }
    
}
